export const sleep = (time = 0) => {
  return new Promise<void>(resolve => {
    setTimeout(() => {
      resolve()
    }, time)
  })
}

// 合并 B 到 A，过滤掉 A 没有的属性
export const mergeWithKeyExist = (a: object, b: object) => {
  Object.keys(b).forEach(k => {
    if (a[k] !== undefined) {
      a[k] = b[k]
    }
  })
}
